package org.jeecg.modules.api.controller;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.client.BizResponse;
import org.jeecg.client.SendUtils;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/monitor/api")
public class MonitorApiController {
    @RequestMapping("runCmd")
    public Result runCmd(@RequestBody Map<String,String> map){
        try {
            BizResponse bizResponse = SendUtils.sendRunCmd(map);
            return Result.OK(bizResponse);
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
}
